Chapter 3 - Printer Drivers
This chapter describes how you can develop printer drivers for printing documents with QuickDraw GX on printing devices. For example, you might develop a printer driver that allows a third-party printer or plotter to print documents created by any application that uses QuickDraw GX.To use this chapter, you need to be familiar with how the printing features in QuickDraw GX work. Inside Macintosh: QuickDraw GX Printing describes these printing features and gives you an overview of the printing process.
Printer drivers include a number of resources. Before reading this chapter, you need some understanding of Macintosh resources and resource files. You can read about them in the Resource Manager chapter in Inside Macintosh: More Macintosh Toolbox.
Printer drivers use collections, which are managed by the Collection Manager. Drivers are activated by messages, which are managed by the Message Manager. You need to know about the Collection Manager and Message Manager components of QuickDraw GX to understand how to develop drivers. The chapter "Introduction to Printing Extensions and Drivers" in this book provides an overview of using these managers in printer drivers. Both of them are described in Inside Macintosh: QuickDraw GX Environment and Utilities.
This chapter begins with an overview of printer drivers and then discusses
For specific reference information about the messages that you override to develop a printer driver, see the chapter "Printing Messages" in this book. For specific reference information about the resources that you need to include in your printer driver file, see the chapter "Printing Resources" in this book.
- the tasks that any printer driver must accomplish
- the source files for a typical printer driver
- the printing messages used to create a printer driver
- the ImageWriter II printer driver as an example of how to construct a printer driver
- the resources used to create the ImageWriter II driver
- the user interface requirements for QuickDraw GX printer drivers
- Note
- The code samples presented in this chapter are taken from a recent version of the the sample code. These samples are not complete and may have been slightly modified since printing. You can find the latest version of the code in the QuickDraw GX sample code.
![]()
Chapter Contents
- About Printer Drivers
- Writing Data to the Spool File
- Reading Data From the Spool File
- Converting QuickDraw GX Shapes
- Communicating With the Printing Device
- Interfacing With the Finder
- Providing a Chooser Interface
- Handling Status and Alert Conditions
- Providing Compatibility With the Macintosh Printing Manager
- Writing Printer Driver Files
- Message Overrides and the Jump Table
- The Message Overrides
- Choosing the Messages to Override
- Forwarding Messages
- Sending Messages
- Handling Exceptions in Your Message Overrides
- Using the Printing-Related Collections
- The QuickDraw GX ImageWriter II Printer Driver Messages
- Initializing the ImageWriter II Environment
- Providing the Application With Printing Options
- Establishing the Preferred Printing Characteristics
- Storing the Current Printer Configuration
- Responding to Direct-Mode Queries
- Setting Up the Parameters for Printing
- Managing Special Page Handling
- Displaying Status Information and the Printing Alert Boxes
- Checking for When an Alert Condition Resolves Itself
- Filling In Alert Information at Run Time
- Displaying Status Text During Printing
- Rendering the Page on the Printing Device
- Terminating the Print Job
- Providing Compatibility in the ImageWriter II Driver
- Color Printing
- Color Matching
- Color Matching on PostScript Devices
- Choosing a Color Space for a PostScript Printing Device
- Using PostScript's Color Matching
- Generating Portable PostScript
- Using Resources in Drivers
- Defining Code Segments in Your Driver
- Defining Version Compatibility for Your Printer Driver
- Specifying Which Messages Your Driver Overrides
- Defining the Imaging System Type of Your Driver
- Specifying How Your Driver Communicates With the Device
- Defining Network Characteristics for Your Driver
- Defining Status Messages
- Resources for Compatibility With the Macintosh Printing Manager
- Defining Device Characteristics Specific to an Imaging System
- User Interface and Chooser Support
- Providing Printing Choices
- The Chooser and Your Driver
- Defining Desktop Printer Icons for Your Printer Driver
- The Desktop Printer Status Icons
- Bundling Your Printer Driver Icons
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help